<?php
	include('koneksi.php');
	$sql1 = "SELECT nis, id_tapel_masuk FROM mr_siswa";
	$qry1 = mysql_query($sql1);
	while($hasil = mysql_fetch_array($qry1)){
		$sql2 = mysql_fetch_array(mysql_query("SELECT count(nis) as jml FROM tagihan_pemb_sekali WHERE nis = '".$hasil['nis']."' AND id_komponen = '18'"));
		$jml  = $sql2['jml'];
		if($jml == 0){
			//echo "insert into tagihan_pemb_sekali values ('','".$hasil['nis']."',18,'".$hasil['id_tapel_masuk']."','0')";
			mysql_query("insert into tagihan_pemb_sekali values ('','".$hasil['nis']."',18,'".$hasil['id_tapel_masuk']."','0')");
		}
	}
?>